package com.zjy.software.day12;

/**
 * 简单自定义泛型
 */
public class Animal<T> {
  private String name;
          
  //根据泛型定义的T，声明一个变量，类型为T
  private T obj;
          
  public String getName() {
    return name;
   }

  public void setName(String name) {
    this.name = name;
   }

  public T getObj() {
    return obj;
   }

  public void setObj(T obj) {
    this.obj = obj;
   }

 @Override
 public String toString() {
  return "Animal{" +
          "name='" + name + '\'' +
          ", obj=" + obj +
          '}';
 }
}

